Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sanitise event of double quotes before processing #60

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

jrwbabylonlab
Copy link
Collaborator

@jrwbabylonlab jrwbabylonlab commented Nov 21, 2024

{"level":"debug","raw_event":{"type":"babylon.btcstaking.v1.EventBTCDelegationExpired","attributes":[{"key":"new_state","value":"\"UNBONDED\"","index":true},{"key":"staking_tx_hash","value":"\"3249d29bb307f2959413b1f76532f23d3d001a8d00f953455fffc41c7db43e5d\"","index":true},{"key":"mode","value":"BeginBlock","index":true}]},"time":"2024-11-22T01:06:16+11:00","message":"Raw event data"}
{"level":"error","error":"failed to parse typed event: json: error calling MarshalJSON for type json.RawMessage: invalid character 'B' looking for beginning of value","time":"2024-11-22T01:06:16+11:00","message":"Failed to process event"}

The issue is BeginBlock field does not have the "" thing in its value

go.mod Outdated
@@ -4,14 +4,14 @@ go 1.23.1

require (
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonlabs-io/babylon v0.16.1
github.com/babylonlabs-io/babylon v0.17.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why update bbn?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing out different fixes, turns out this is not the issue. but we shall keep the bbn version up to date anyway, no?

Copy link
Collaborator

@gusin13 gusin13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, lgtm

this also fixes
#24

@gusin13 gusin13 merged commit 5486858 into main Nov 21, 2024
9 checks passed
@gusin13 gusin13 deleted the sanitise-event-before-processing branch November 21, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants